1. Field of the Invention
The present invention relates to a sensor device for detecting a physical quantity and converting the detected physical quantity such as magnetic field intensity into an electric signal.
2. Description of the Related Art
A magnetic sensor device is used as a sensor for detecting an open/close state in a flip mobile phone, a notebook computer, or the like and as a sensor for detecting a rotary position of a motor or the like (see, for example, Japanese Patent Application Laid-open No. 2010-281801).
FIG. 18 illustrates a circuit diagram of a conventional magnetic sensor device. In the conventional magnetic sensor device, a magnetoelectric conversion element (such as Hall element) outputs a voltage corresponding to (typically, substantially proportional to) magnetic field intensity (or magnetic flux density), the output voltage is amplified by an amplifier, and a comparator is used to determine whether the amplified output voltage is larger or smaller than a predetermined magnetic field intensity or magnetic flux density (the result is output as a binary value, H signal or L signal).
In general, the output voltage of the magnetoelectric conversion element is minute, and hence an error may occur due to an offset voltage of the magnetoelectric conversion element (element offset voltage), an offset voltage of the amplifier or the comparator (input offset voltage), and noise of those components, and the accuracy may be lower. For example, the element offset voltage is generated by stress on the magnetoelectric conversion element received from a package. For example, the input offset voltage is generated by characteristic fluctuations in elements of an input circuit of the amplifier or the comparator. The noise is generated mainly by flicker noise of a single transistor of the circuit or thermal noise of a single transistor or a resistive element.
The magnetic sensor device illustrated in FIG. 18 is configured as follows in order to reduce the influence of the offset voltages of the magnetoelectric conversion element, the amplifier, and the comparator. The magnetic sensor device includes a Hall element 1801, a switch circuit 1802 for switching the Hall element 1801 between a first detection state and a second detection state, a differential amplifier 1803 for amplifying a voltage difference (V1−V2) of two output terminals of the switch circuit 1802, a comparator 1805, a capacitor 1804 connected between one output terminal of the differential amplifier 1803 and an inverting input terminal of the comparator 1805, a switch 1807 connected between the other output terminal of the differential amplifier 1803 and a non-inverting input terminal of the comparator 1805, a switch 1806 connected between the inverting input terminal and an output terminal of the comparator 1805, a detection voltage setting circuit 1815, and a capacitor 1808 connected between the non-inverting input terminal of the comparator 1805 and an output terminal of the detection voltage setting circuit 1815. The detection voltage setting circuit 1815 includes resistors 1811 to 1814 connected in series between power supply terminals, and switches 1809, 1810x, and 1810z connected between connection points of the respective resistors and the output terminal.
The magnetic sensor device of FIG. 18 operates under control of the switches 1806, 1807, 1809, 1810x, and 1810z in accordance with a timing chart illustrated in FIG. 19. The switches 1810x and 1810z are controlled by a signal 1810 of FIG. 19. When the signal 1810 is ON, one of the switches 1810x and 1810z is turned ON. When the signal 1810 is OFF, the switches 1810x and 1810z are both turned OFF. One period T of the detection operation is divided into a first detection state T1 and a second detection state T2 depending on the operation of the switch circuit 1802 as described above. In the first detection state T1, a power supply voltage is input from terminals A and C of the Hall element 1801, and a signal voltage is output from terminals B and D thereof.
In the second detection state T2, the power supply voltage is input from the terminals B and D, and a signal voltage is output from the terminals A and C. Now, a common-mode signal voltage (hereinafter referred to as “element common-mode voltage”) of the Hall element 1801 is represented by Vcm, a differential signal voltage (hereinafter referred to as “element signal voltage”) corresponding to the magnetic field intensity of the Hall element 1801 is represented by Vh, an offset voltage (hereinafter referred to as “element offset voltage”) of the Hall element 1801 is represented by Voh, the gain of the differential amplifier 1803 is represented by G, input offset voltages of the input terminals V1 and V2 of the differential amplifier 1803 are represented by Voa1 and Voa2, respectively, and an input offset voltage of the comparator 1805 is represented by Voa3.
The element common-mode voltages Vcm in the first detection state T1 and the second detection state T2 are represented by Vcm1 and Vcm2, respectively, the element signal voltages Vh in the first detection state T1 and the second detection state T2 are represented by Vh1 and Vh2, respectively, and the element offset voltages Voh in the first detection state T1 and the second detection state T2 are represented by Voh1 and Voh2, respectively. Voh1 and Voh2 are substantially equal values. The element offset voltages Voh of the Hall element 1801 may be canceled out by a known method, typically called “spinning current”. Specifically, the switch circuit 1802 is switched so as to obtain an element offset component that is reverse in phase to a common-mode signal component (or an element offset component that is in-phase to a normal-mode signal component), thereby cancelling out the offset components. One period is further divided into a first phase φ1, a second phase φ2, and a third phase φ3 depending on the open/close states of the respective switches.
In the first phase φ1, the switches 1806 and 1807 are turned ON, and a voltage VC1=V3−V5 is charged in the capacitor 1804. The switch 1806 is turned ON, and hence the comparator 1805 operates as a voltage follower circuit. The Hall element 1801 and the switch circuit 1802 are in the first detection state T1. In the first phase φ1, the respective nodes have the following voltages.
V1=Vcm1+Vh1/2+Voh1/2
V2=Vcm1−Vh1/2−Voh1/2
V3=Vcm1+G·Vh1/2+G·Voh1/2+G·Voa1
V4=Vcm1−G·Vh1/2−G·Voh1/2+G·Voa2
V5=VO=V6+Voa3
V6=V4
The voltage VC1 charged in the capacitor 1804 is expressed as follows.VC1=V3−V5=G·Vh1+G·Voh1+G·Voa1−G·Voa2−Voa3  (a)
In the second phase φ2, the switch 1806 is turned OFF, and the Hall element 1801 and the switch circuit 1802 enter the second detection state T2. In the detection voltage setting circuit 1815, the switch 1809 is turned ON while the switches 1810x and 1810z are turned OFF, and a voltage Vr corresponding to one of the voltage-dividing points of the series-connected resistors 1811 to 1814 is supplied to the output terminal as a reference voltage Vref1. Therefore, a voltage Vc2=V6−Vref1=V6−Vr is charged in the capacitor 1808. In the second phase φ2, the respective nodes have the following voltages.
V1=Vcm2−Vh2/2+Voh2/2
V2=Vcm2+Vh2/2−Voh2/2
V3=Vcm2−G·Vh2/2+G·Voh2/2+G·Voa1
V4=Vcm2+G·Vh2/2−G·Voh2/2+G·Voa2
The voltage VC1 expressed by Expression (a) is held in the capacitor 1804, and hence the node V5 has the following voltage.V5=V3−VC1=Vcm2−G·Vh2/2−G·Vh1−G·Voh1+G·Voh2/2+G·Voa2+Voa3  (b)
Based on V6=V4, the voltage VC2 charged in the capacitor 1808 is expressed as follows.VC2=V6−Vref1=V4−Vr=Vcm2+G·Vh2/2−G·Voh2/2+G·Voa2−Vr  (c)
In the third phase φ3, the switch 1807 and the switch 1809 are turned OFF, and the switch 1810x or 1810z is turned ON. In this example, the switch 1810x is turned ON. The reference voltage Vref1 is changed to a voltage Vrx corresponding to one of the voltage-dividing points of the series-connected resistors 1811 to 1814. The voltage VC2 expressed by Expression (c) is held in the capacitor 1808, and hence the node V6 has the following voltage.V6=Vc2+Vrx=V6−Vref1=V4−Vr=Vcm2+G·Vh2/2−G·Voh2/2+G·Voa2−Vr+Vrx  (d)
Finally, the voltage V5 expressed by Expression (b) and the voltage V6 expressed by Expression (d) are compared to each other in the comparator 1805, and High level or Low level is output from an output terminal VO. Taking the input offset voltage Voa3 of the comparator 1805 into account, the voltages to be compared in the comparator 1805 are expressed as follows.(V6+Voa3)−V5=G(Vh1+Vh2)+G(Voh1−Voh2)−(Vr−Vrx)  (e)
In this case, the element offset voltages Voh1 and Voh2 are substantially equal values and therefore canceled out. Expression (e) does not include the input offset voltages Voa1 and Voa2 of the differential amplifier 1803 or the input offset voltage Voa3 of the comparator 1805, thus indicating that those offset voltages are canceled out. Therefore, in the third phase φ3, the comparator 1804 compares the signal component G(Vh1+Vh2) to the reference voltage component (Vr−Vrx) determined by the detection voltage setting circuit 1815. This operation removes the influence of the offset voltage components of the Hall element and the offset voltage components of the differential amplifier and the comparator, which are responsible for an error, thus realizing a magnetic sensor capable of highly-precise output with less fluctuation.
In recent years, however, high-speed operation is required in applications such as motor rotation detection. In the conventional magnetic sensor device described above, one period of the detection operation is made up of three phases, and hence it has been difficult to respond to high-speed operation. Although the conventional magnetic sensor device may be increased in operating speed by shortening the time periods of the respective phases, it is necessary to speed up the operation of the differential amplifier and the comparator. The circuit area becomes larger with an increase in current consumption of the differential amplifier in particular.